Imports obout_ASPTreeView_Pro_NET
Imports ccapps.persistent.authorization
Imports ccapps.persistent.blackBerry
Imports ccapps.persistent.common

Namespace Web.page
    Public Class BlackBerry_Main
        Inherits [lib].BasePage

#Region " Web Form Designer Generated Code "

        'This call is required by the Web Form Designer.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

        End Sub
        Protected WithEvents custcode As System.Web.UI.WebControls.TextBox
        Protected WithEvents msisdn As System.Web.UI.WebControls.TextBox
        Protected WithEvents Lblok As System.Web.UI.WebControls.Label
        Protected WithEvents proc As System.Web.UI.HtmlControls.HtmlInputHidden

        'NOTE: The following placeholder declaration is required by the Web Form Designer.
        'Do not delete or move it.
        Private designerPlaceholderDeclaration As System.Object

        Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            'CODEGEN: This method call is required by the Web Form Designer
            'Do not modify it using the code editor.
            InitializeComponent()
        End Sub

#End Region

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.PageTitle = "BlackBerry"
            Me.HelpDocName = "help_EmployeeOverLimit.html"

            Dim customerCode As String = Me.custcode.Text
            Dim Vproc As String
            Vproc = Me.proc.Value
            Me.proc.Value = ""

            If Vproc <> "" And Me.custcode.Text = "" And Me.msisdn.Text = "" Then
                Message = "alert('CustomerCode veya msisdn girmelisiniz ! ')"
                Exit Sub
            End If

            If Vproc <> "" Then
                Dim sql As String
                Dim DS = New myDBConn
                If Me.custcode.Text <> "" Then
                    'sql = " select * from customer_all where custcode ='" & Me.custcode.Text & "' "
                    If CustomerControl(Me.custcode.Text).Rows().Count = 0 Then
                        Message = "alert('CustomerCode bulunamadi ! ')"
                        DS = Nothing
                        Exit Sub
                    End If
                Else
                    'sql = " select custcode,cslevel,(select custcode from customer_all where customer_id=a.customer_id_high ) from customer_all a where customer_id in "
                    'sql = sql + " (select customer_id_high from customer_all where customer_id in "
                    'sql = sql + " (select customer_id_high from customer_all where customer_id= "
                    'sql = sql + " (select fn_msisdn_to_custid('" & Me.msisdn.Text & "') from dual) "
                    'sql = sql + " ) and (cslevel='20' or cslevel='30') "
                    'sql = sql + " ) and (cslevel='10' or cslevel='20') "

                    Dim temp As DataTable
                    temp = msisdnTOcustcode(Me.msisdn.Text)
                    If temp.Rows().Count = 0 Then
                        Message = "alert('Bu MSISDN e ait sirket bulunamadi ! ')"
                        DS = Nothing
                        Exit Sub
                    Else
                        'If temp.Rows(0)(1) = "10" Then
                        '    customerCode = temp.Rows(0)(0)
                        'Else
                        '    customerCode = temp.Rows(0)(2)
                        'End If
                        If temp.Rows(0)(1) = "20" Then
                            customerCode = temp.Rows(0)(0)
                        End If

                        DS = Nothing
                    End If

                End If

            End If

            'Dim custcode2 As String = "1.234"

            Select Case Vproc
                Case "FindScr"
                    'Response.Redirect("BlackBerry_LA_Detail.aspx?custcode=" & customerCode & "&custcode=" & custcode2)
                Case "FindScr2"
                    Response.Redirect("BlackBerry_LA_Detail_2.aspx?custcode=" & customerCode)
            End Select


        End Sub

    End Class
End Namespace
